package com.first.order.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.first.common.pojo.EduCourse;
import com.first.common.pojo.EduTeacher;
import com.first.order.dao.EduTeacherDao;
import com.first.order.service.EduTeacherService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;

import java.util.List;

/**
 * @program: SecondProject
 * @description:
 * @author: 李榕轩
 * @create: 2023-05-27 17:32
 **/
@Service
public class EduTeacherServiceImpl implements EduTeacherService {
    @Autowired
    private EduTeacherDao eduTeacherDao;

    @Override
    public EduTeacher  queryAllTeacherBYTeacherName(String teacherName) {
        QueryWrapper<EduTeacher> wrapper = new QueryWrapper<>();
        if (StringUtils.hasText(teacherName)){
            wrapper.eq("name",teacherName);
        }


        EduTeacher eduTeacher = eduTeacherDao.selectOne(wrapper);
        return eduTeacher;
    }
}
